import os

def fix_path(path):
    path = os.path.expandvars(path)
    path = os.path.normcase(path)
    return path

def setenv_add_paths(name, paths):
    name = name.upper()
    if type(paths) == str:
        paths = [paths]
    paths = [fix_path(i) for i in paths]
    for path in paths:
        os.system('setenv -ua ' + name + ' %"' + path + '"')
        print "Added '" + path + "'"
        print "to the '" + name + "' environment variable."

current_dir =  os.getcwd()
bin_dir = current_dir + "\\bin"
lib_dir = current_dir + "\\lib"
setenv_add_paths("PATH", [bin_dir])
setenv_add_paths("PYTHONPATH", [lib_dir])
raw_input("Press any key to exit...")
